<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"> 
    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h2>Cartórios</h2>
            <p:panel styleClass="container_24 clearfix "  style="background: none; border: none;">
                <h:form id="form" acceptcharset="utf-8">
                    <p:growl id="msg" life="5000"/>

                    <p:menu styleClass="grid_5" >  
                        <p:submenu label="Cartório">  
                            <p:menuitem value="Cadastrar" actionListener="#{managerRedirect.redirect('createNotaryOffice.xhtml')}"
                                        update="@form" icon="ui-icon-circle-plus"/>  
                            <p:menuitem value="Pesquisar" actionListener="#{managerRedirect.redirect('searchNotaryOffice.xhtml')}"
                                        icon="ui-icon-circle-zoomout"/>   
                        </p:submenu>
                    </p:menu>
                    
                    <div class="grid_18">
                     <p class="subtitle">Cartórios Recentes</p>
                    <p:dataTable value="#{managerSearchNotaryOffice.lstNotaryOffices()}"
                                 var="c" emptyMessage="Nenhum Cartório"
                                 style="width:100%;"
                                 >                       

                        <p:column headerText="Nome" style="font-size: 12px;">
                            <h:outputText value="#{c.nome}" style="font-size: 12px;"/>
                        </p:column>
                        <p:column headerText="Titular" style="font-size: 12px;">
                            <h:outputText value="#{c.titular}" style="font-size: 12px;"/>
                        </p:column>
                        <p:column headerText="Contato" style="font-size: 12px;">
                            <h:outputText value="Cel: #{c.address.cellular} Tel: #{c.address.phone} " style="font-size: 12px;"/>
                        </p:column>
                        <p:column headerText="Opções" style="font-size: 12px;">
                            <p:commandButton icon="ui-icon-folder-collapsed" actionListener="#{managerEditNotaryOffice.redirect('editNotaryOffice.xhtml', c)}" title="Editar" />
                            <p:commandButton icon="ui-icon-circle-zoomin" actionListener="#{managerSearchNotaryOffice.redirect('showNotaryOffice.xhtml', c)}" title="Visualizar" />
                            <p:commandButton icon="ui-icon-trash" title="Excluir" update="@form"  />
                        </p:column>
                    </p:dataTable>
                    </div>
                </h:form>
            </p:panel>
        </ui:define>
    </ui:composition>
</html>